package com.szxy.fail;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.http.ResponseEntity;

/**
 * @Author: zwz
 * @Date:2020/7/14 22:00
 * @Description:com.szxy.fail
 * @Version:1.0
 * 注意：方法必须是静态方法
 **/
public class BlockHandleConf {

    /**
     * block 方法回退
     * @param type
     * @param e
     * @return
     */
    public static ResponseEntity rpcHandler(String type, BlockException e) {
        return ResponseEntity.ok("异常类型为" + type + ",sentinel 规则错误, 错误信息为：" + e);
    }
}
